package com.heima.user.feign;

import com.heima.apis.user.IApAuthClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.user.service.ApAuthService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApAuthClient implements IApAuthClient {
    private final ApAuthService apAuthService;

    public ApAuthClient(ApAuthService apAuthService) {
        this.apAuthService = apAuthService;
    }

    /**
     * 用户审核查询列表
     * @param authDto
     * @return
     */
    @PostMapping("/api/v1/list")
    @ApiOperation("查询列表")
    public ResponseResult listAuth(@RequestBody AuthDto authDto){
        return apAuthService.listAuth(authDto);
    }


    /**
     * 审核失败
     * @param authDto
     * @return
     */
    @PostMapping("/api/v1/authFail")
    @ApiOperation("审核失败")
    public ResponseResult authFail(@RequestBody AuthDto authDto){
        return apAuthService.authFail(authDto);
    }

    /**
     * 审核成功
     * @param authDto
     * @return
     */
    @PostMapping("/api/v1/authPass")
    @ApiOperation("审核成功")
    public ResponseResult authPass(@RequestBody AuthDto authDto){
        return apAuthService.authPass(authDto);
    }
}
